package com.mrzhou.auth.support;

import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * 无密码加密
 */
public class CloudNoPasswordEncoder implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        return charSequence.toString();
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return charSequence.toString().equals(s);
    }

    public static PasswordEncoder getInstance(){
        return psw;
    }

    private static final PasswordEncoder psw = new CloudNoPasswordEncoder();

    private CloudNoPasswordEncoder(){

    }
}
